home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows Expert
/
Windows Expert.iso
/
windownt
/
perlnt.zip
/
patches
< prev
next >
Wrap
Text File
|
1993-07-25
|
56KB
|
2,208 lines
*** ../src-4.036/cmd.c Tue Apr 6 15:42:20 1993
--- cmd.c Fri May 21 09:17:52 1993
***************
*** 38,43 ****
--- 41,49 ----
# include <varargs.h>
#endif
+ #ifdef I_STDARG
+ # include <stdarg.h>
+ #endif
static STR strchop;
void grow_dlevel();
*** ../src-4.036/config.h Tue Apr 6 15:42:14 1993
--- config.h Fri May 21 10:22:57 1993
***************
*** 1,17 ****
#ifndef config_h
#define config_h
- /* config.h
- * This file was produced by running the config.h.SH script, which
- * gets its values from config.sh, which is generally produced by
- * running Configure.
- *
- * Feel free to modify any of this as the need arises. Note, however,
- * that running config.h.SH again will wipe out any changes you've made.
- * For a more permanent change edit config.sh and rerun config.h.SH.
- */
- /*SUPPRESS 460*/
-
/* EUNICE
* This symbol, if defined, indicates that the program is being compiled
* under the EUNICE package under VMS. The program will need to handle
--- 1,8 ----
+ /* This is the config.h for the Windows NT port of Perl */
+
#ifndef config_h
#define config_h
/* EUNICE
* This symbol, if defined, indicates that the program is being compiled
* under the EUNICE package under VMS. The program will need to handle
***************
*** 42,48 ****
* to keep publicly executable images for the package in question. It
* is most often a local directory such as /usr/local/bin.
*/
! #define BIN "/usr/local/bin" /**/
/* BYTEORDER
* This symbol contains an encoding of the order of bytes in a long.
--- 33,40 ----
* to keep publicly executable images for the package in question. It
* is most often a local directory such as /usr/local/bin.
*/
! #define BIN (char *)NtGetBin()
! #define DEFBIN "c:\\win32app\\ingr\\perl\\bin"
/* BYTEORDER
* This symbol contains an encoding of the order of bytes in a long.
***************
*** 61,67 ****
* output. This symbol will have the value "-" if CPPSTDIN needs a minus
* to specify standard input, otherwise the value is "".
*/
! #define CPPSTDIN "cppstdin"
#define CPPMINUS ""
/* HAS_BCMP
--- 53,59 ----
* output. This symbol will have the value "-" if CPPSTDIN needs a minus
* to specify standard input, otherwise the value is "".
*/
! #define CPPSTDIN "cpp"
#define CPPMINUS ""
/* HAS_BCMP
***************
*** 69,75 ****
* to compare blocks of memory. If undefined, use memcmp. If that's
* not available, roll your own.
*/
! #define HAS_BCMP /**/
/* HAS_BCOPY
* This symbol, if defined, indicates that the bcopy routine is available
--- 61,67 ----
* to compare blocks of memory. If undefined, use memcmp. If that's
* not available, roll your own.
*/
! /*#undef HAS_BCMP /**/
/* HAS_BCOPY
* This symbol, if defined, indicates that the bcopy routine is available
***************
*** 82,96 ****
* should probably use memmove() or memcpy(). If neither is defined,
* roll your own.
*/
! #define HAS_BCOPY /**/
! #define SAFE_BCOPY /**/
/* HAS_BZERO
* This symbol, if defined, indicates that the bzero routine is available
* to zero blocks of memory. Otherwise you should probably use memset()
* or roll your own.
*/
! #define HAS_BZERO /**/
/* CASTNEGFLOAT
* This symbol, if defined, indicates that this C compiler knows how to
--- 74,88 ----
* should probably use memmove() or memcpy(). If neither is defined,
* roll your own.
*/
! /*#undef HAS_BCOPY /**/
! /*#undef SAFE_BCOPY /**/
/* HAS_BZERO
* This symbol, if defined, indicates that the bzero routine is available
* to zero blocks of memory. Otherwise you should probably use memset()
* or roll your own.
*/
! /*#undef HAS_BZERO /**/
/* CASTNEGFLOAT
* This symbol, if defined, indicates that this C compiler knows how to
***************
*** 118,136 ****
* This symbol, if defined, indicates that the chsize routine is available
* to truncate files. You might need a -lx to get this routine.
*/
! /*#undef HAS_CHSIZE /**/
/* HAS_CRYPT
* This symbol, if defined, indicates that the crypt routine is available
* to encrypt passwords and the like.
*/
! #define HAS_CRYPT /**/
/* CSH
* This symbol, if defined, indicates that the C-shell exists.
* If defined, contains the full pathname of csh.
*/
! #define CSH "/bin/csh" /**/
/* DOSUID
* This symbol, if defined, indicates that the C program should
--- 110,128 ----
* This symbol, if defined, indicates that the chsize routine is available
* to truncate files. You might need a -lx to get this routine.
*/
! #define HAS_CHSIZE /**/
/* HAS_CRYPT
* This symbol, if defined, indicates that the crypt routine is available
* to encrypt passwords and the like.
*/
! /*#undef HAS_CRYPT /**/
/* CSH
* This symbol, if defined, indicates that the C-shell exists.
* If defined, contains the full pathname of csh.
*/
! /*#undef CSH "/bin/csh" /**/
/* DOSUID
* This symbol, if defined, indicates that the C program should
***************
*** 169,175 ****
* This symbol, if defined, indicates to the C program that
* the fcntl() function exists.
*/
! #define HAS_FCNTL /**/
/* FLEXFILENAMES
* This symbol, if defined, indicates that the system supports filenames
--- 161,167 ----
* This symbol, if defined, indicates to the C program that
* the fcntl() function exists.
*/
! /*#undef HAS_FCNTL /**/
/* FLEXFILENAMES
* This symbol, if defined, indicates that the system supports filenames
***************
*** 188,212 ****
* available to get the list of process groups. If unavailable, multiple
* groups are probably not supported.
*/
! #define HAS_GETGROUPS /**/
/* HAS_GETHOSTENT
* This symbol, if defined, indicates that the gethostent() routine is
* available to lookup host names in some data base or other.
*/
! #define HAS_GETHOSTENT /**/
/* HAS_GETPGRP
* This symbol, if defined, indicates that the getpgrp() routine is
* available to get the current process group.
*/
! #define HAS_GETPGRP /**/
/* HAS_GETPGRP2
* This symbol, if defined, indicates that the getpgrp2() (as in DG/UX)
* routine is available to get the current process group.
*/
! #define HAS_GETPGRP2 /**/
/* HAS_GETPRIORITY
* This symbol, if defined, indicates that the getpriority() routine is
--- 180,204 ----
* available to get the list of process groups. If unavailable, multiple
* groups are probably not supported.
*/
! /*#undef HAS_GETGROUPS /**/
/* HAS_GETHOSTENT
* This symbol, if defined, indicates that the gethostent() routine is
* available to lookup host names in some data base or other.
*/
! /*#undef HAS_GETHOSTENT /**/
/* HAS_GETPGRP
* This symbol, if defined, indicates that the getpgrp() routine is
* available to get the current process group.
*/
! /*#undef HAS_GETPGRP /**/
/* HAS_GETPGRP2
* This symbol, if defined, indicates that the getpgrp2() (as in DG/UX)
* routine is available to get the current process group.
*/
! /*#undef HAS_GETPGRP2 /**/
/* HAS_GETPRIORITY
* This symbol, if defined, indicates that the getpriority() routine is
***************
*** 257,269 ****
* to kill process groups. If unavailable, you probably should use kill
* with a negative process number.
*/
! #define HAS_KILLPG /**/
/* HAS_LSTAT
* This symbol, if defined, indicates that the lstat() routine is
* available to stat symbolic links.
*/
! #define HAS_LSTAT /**/
/* HAS_MEMCMP
* This symbol, if defined, indicates that the memcmp routine is available
--- 249,261 ----
* to kill process groups. If unavailable, you probably should use kill
* with a negative process number.
*/
! /*#undef HAS_KILLPG /**/
/* HAS_LSTAT
* This symbol, if defined, indicates that the lstat() routine is
* available to stat symbolic links.
*/
! /*#undef HAS_LSTAT /**/
/* HAS_MEMCMP
* This symbol, if defined, indicates that the memcmp routine is available
***************
*** 309,345 ****
* This symbol, if defined, indicates that the entire msg*(2) library is
* supported.
*/
! #define HAS_MSG /**/
/* HAS_MSGCTL
* This symbol, if defined, indicates that the msgctl() routine is
* available to control message passing.
*/
! #define HAS_MSGCTL /**/
/* HAS_MSGGET
* This symbol, if defined, indicates that the msgget() routine is
* available to get messages.
*/
! #define HAS_MSGGET /**/
/* HAS_MSGRCV
* This symbol, if defined, indicates that the msgrcv() routine is
* available to receive messages.
*/
! #define HAS_MSGRCV /**/
/* HAS_MSGSND
* This symbol, if defined, indicates that the msgsnd() routine is
* available to send messages.
*/
! #define HAS_MSGSND /**/
/* HAS_NDBM
* This symbol, if defined, indicates that ndbm.h exists and should
* be included.
*/
! #define HAS_NDBM /**/
/* HAS_ODBM
* This symbol, if defined, indicates that dbm.h exists and should
--- 301,337 ----
* This symbol, if defined, indicates that the entire msg*(2) library is
* supported.
*/
! /*#undef HAS_MSG /**/
/* HAS_MSGCTL
* This symbol, if defined, indicates that the msgctl() routine is
* available to control message passing.
*/
! /*#undef HAS_MSGCTL /**/
/* HAS_MSGGET
* This symbol, if defined, indicates that the msgget() routine is
* available to get messages.
*/
! /*#undef HAS_MSGGET /**/
/* HAS_MSGRCV
* This symbol, if defined, indicates that the msgrcv() routine is
* available to receive messages.
*/
! /*#undef HAS_MSGRCV /**/
/* HAS_MSGSND
* This symbol, if defined, indicates that the msgsnd() routine is
* available to send messages.
*/
! /*#undef HAS_MSGSND /**/
/* HAS_NDBM
* This symbol, if defined, indicates that ndbm.h exists and should
* be included.
*/
! /*#undef HAS_NDBM /**/
/* HAS_ODBM
* This symbol, if defined, indicates that dbm.h exists and should
***************
*** 351,357 ****
* This manifest constant lets the C program know that the three
* argument form of open(2) is available.
*/
! #define HAS_OPEN3 /**/
/* HAS_READDIR
* This symbol, if defined, indicates that the readdir routine is available
--- 343,349 ----
* This manifest constant lets the C program know that the three
* argument form of open(2) is available.
*/
! /*#undef HAS_OPEN3 /**/
/* HAS_READDIR
* This symbol, if defined, indicates that the readdir routine is available
***************
*** 389,419 ****
* This symbol, if defined, indicates that the select() subroutine
* exists.
*/
! #define HAS_SELECT /**/
/* HAS_SEM
* This symbol, if defined, indicates that the entire sem*(2) library is
* supported.
*/
! #define HAS_SEM /**/
/* HAS_SEMCTL
* This symbol, if defined, indicates that the semctl() routine is
* available to control semaphores.
*/
! #define HAS_SEMCTL /**/
/* HAS_SEMGET
* This symbol, if defined, indicates that the semget() routine is
* available to get semaphores ids.
*/
! #define HAS_SEMGET /**/
/* HAS_SEMOP
* This symbol, if defined, indicates that the semop() routine is
* available to perform semaphore operations.
*/
! #define HAS_SEMOP /**/
/* HAS_SETEGID
* This symbol, if defined, indicates that the setegid routine is available
--- 381,411 ----
* This symbol, if defined, indicates that the select() subroutine
* exists.
*/
! /*#undef HAS_SELECT /**/
/* HAS_SEM
* This symbol, if defined, indicates that the entire sem*(2) library is
* supported.
*/
! /*#undef HAS_SEM /**/
/* HAS_SEMCTL
* This symbol, if defined, indicates that the semctl() routine is
* available to control semaphores.
*/
! /*#undef HAS_SEMCTL /**/
/* HAS_SEMGET
* This symbol, if defined, indicates that the semget() routine is
* available to get semaphores ids.
*/
! /*#undef HAS_SEMGET /**/
/* HAS_SEMOP
* This symbol, if defined, indicates that the semop() routine is
* available to perform semaphore operations.
*/
! /*#undef HAS_SEMOP /**/
/* HAS_SETEGID
* This symbol, if defined, indicates that the setegid routine is available
***************
*** 431,443 ****
* This symbol, if defined, indicates that the setpgrp() routine is
* available to set the current process group.
*/
! #define HAS_SETPGRP /**/
/* HAS_SETPGRP2
* This symbol, if defined, indicates that the setpgrp2() (as in DG/UX)
* routine is available to set the current process group.
*/
! #define HAS_SETPGRP2 /**/
/* HAS_SETPRIORITY
* This symbol, if defined, indicates that the setpriority() routine is
--- 423,435 ----
* This symbol, if defined, indicates that the setpgrp() routine is
* available to set the current process group.
*/
! /*#undef HAS_SETPGRP /**/
/* HAS_SETPGRP2
* This symbol, if defined, indicates that the setpgrp2() (as in DG/UX)
* routine is available to set the current process group.
*/
! /*#undef HAS_SETPGRP2 /**/
/* HAS_SETPRIORITY
* This symbol, if defined, indicates that the setpriority() routine is
***************
*** 485,491 ****
* This symbol, if defined, indicates that the entire shm*(2) library is
* supported.
*/
! #define HAS_SHM /**/
/* HAS_SHMAT
* This symbol, if defined, indicates that the shmat() routine is
--- 477,483 ----
* This symbol, if defined, indicates that the entire shm*(2) library is
* supported.
*/
! /*#undef HAS_SHM /**/
/* HAS_SHMAT
* This symbol, if defined, indicates that the shmat() routine is
***************
*** 495,501 ****
* This symbol, if defined, indicates that the shmat() routine
* returns a pointer of type void*.
*/
! #define HAS_SHMAT /**/
/*#undef VOIDSHMAT /**/
--- 487,493 ----
* This symbol, if defined, indicates that the shmat() routine
* returns a pointer of type void*.
*/
! /*#undef HAS_SHMAT /**/
/*#undef VOIDSHMAT /**/
***************
*** 503,521 ****
* This symbol, if defined, indicates that the shmctl() routine is
* available to control a shared memory segment.
*/
! #define HAS_SHMCTL /**/
/* HAS_SHMDT
* This symbol, if defined, indicates that the shmdt() routine is
* available to detach a shared memory segment.
*/
! #define HAS_SHMDT /**/
/* HAS_SHMGET
* This symbol, if defined, indicates that the shmget() routine is
* available to get a shared memory segment id.
*/
! #define HAS_SHMGET /**/
/* HAS_SOCKET
* This symbol, if defined, indicates that the BSD socket interface is
--- 495,513 ----
* This symbol, if defined, indicates that the shmctl() routine is
* available to control a shared memory segment.
*/
! /*#undef HAS_SHMCTL /**/
/* HAS_SHMDT
* This symbol, if defined, indicates that the shmdt() routine is
* available to detach a shared memory segment.
*/
! /*#undef HAS_SHMDT /**/
/* HAS_SHMGET
* This symbol, if defined, indicates that the shmget() routine is
* available to get a shared memory segment id.
*/
! /*#undef HAS_SHMGET /**/
/* HAS_SOCKET
* This symbol, if defined, indicates that the BSD socket interface is
***************
*** 531,537 ****
*/
#define HAS_SOCKET /**/
! #define HAS_SOCKETPAIR /**/
/*#undef OLDSOCKET /**/
--- 523,529 ----
*/
#define HAS_SOCKET /**/
! /*#undef HAS_SOCKETPAIR /**/
/*#undef OLDSOCKET /**/
***************
*** 564,576 ****
* This symbol, if defined, indicates that the symlink routine is available
* to create symbolic links.
*/
! #define HAS_SYMLINK /**/
/* HAS_SYSCALL
* This symbol, if defined, indicates that the syscall routine is available
* to call arbitrary system calls. If undefined, that's tough.
*/
! #define HAS_SYSCALL /**/
/* HAS_TELLDIR
* This symbol, if defined, indicates that the telldir routine is
--- 556,568 ----
* This symbol, if defined, indicates that the symlink routine is available
* to create symbolic links.
*/
! /*#undef HAS_SYMLINK /**/
/* HAS_SYSCALL
* This symbol, if defined, indicates that the syscall routine is available
* to call arbitrary system calls. If undefined, that's tough.
*/
! /*#undef HAS_SYSCALL /**/
/* HAS_TELLDIR
* This symbol, if defined, indicates that the telldir routine is
***************
*** 587,593 ****
/* HAS_VFORK
* This symbol, if defined, indicates that vfork() exists.
*/
! #define HAS_VFORK /**/
/* VOIDSIG
* This symbol is defined if this system declares "void (*signal())()" in
--- 579,585 ----
/* HAS_VFORK
* This symbol, if defined, indicates that vfork() exists.
*/
! /*#undef HAS_VFORK /**/
/* VOIDSIG
* This symbol is defined if this system declares "void (*signal())()" in
***************
*** 602,608 ****
* handler using "TO_SIGNAL handler(sig)".
*/
#define VOIDSIG /**/
! #define TO_SIGNAL int /**/
/* HASVOLATILE
* This symbol, if defined, indicates that this C compiler knows about
--- 594,600 ----
* handler using "TO_SIGNAL handler(sig)".
*/
#define VOIDSIG /**/
! #define TO_SIGNAL void /**/
/* HASVOLATILE
* This symbol, if defined, indicates that this C compiler knows about
***************
*** 632,650 ****
/* HAS_WAITPID
* This symbol, if defined, indicates that waitpid() exists.
*/
! #define HAS_WAITPID /**/
/* GIDTYPE
* This symbol has a value like gid_t, int, ushort, or whatever type is
* used to declare group ids in the kernel.
*/
! #define GIDTYPE gid_t /**/
/* GROUPSTYPE
* This symbol has a value like gid_t, int, ushort, or whatever type is
* used in the return value of getgroups().
*/
! #define GROUPSTYPE gid_t /**/
/* I_FCNTL
* This manifest constant tells the C program to include <fcntl.h>.
--- 624,642 ----
/* HAS_WAITPID
* This symbol, if defined, indicates that waitpid() exists.
*/
! /*#undef HAS_WAITPID /**/
/* GIDTYPE
* This symbol has a value like gid_t, int, ushort, or whatever type is
* used to declare group ids in the kernel.
*/
! #define GIDTYPE unsigned short
/* GROUPSTYPE
* This symbol has a value like gid_t, int, ushort, or whatever type is
* used in the return value of getgroups().
*/
! /*#undef GROUPSTYPE gid_t /**/
/* I_FCNTL
* This manifest constant tells the C program to include <fcntl.h>.
***************
*** 661,667 ****
* This symbol, if defined, indicates to the C program that it should
* include grp.h.
*/
! #define I_GRP /**/
/* I_NETINET_IN
* This symbol, if defined, indicates to the C program that it should
--- 653,659 ----
* This symbol, if defined, indicates to the C program that it should
* include grp.h.
*/
! /*#undef I_GRP /**/
/* I_NETINET_IN
* This symbol, if defined, indicates to the C program that it should
***************
*** 671,677 ****
* This symbol, if defined, indicates to the C program that it should
* include sys/in.h.
*/
! #define I_NETINET_IN /**/
/*#undef I_SYS_IN /**/
/* I_PWD
--- 663,669 ----
* This symbol, if defined, indicates to the C program that it should
* include sys/in.h.
*/
! /*#undef I_NETINET_IN /**/
/*#undef I_SYS_IN /**/
/* I_PWD
***************
*** 702,714 ****
* This symbol, if defined, indicates to the C program that struct passwd
* contains pw_comment.
*/
! #define I_PWD /**/
/*#undef PWQUOTA /**/
! #define PWAGE /**/
/*#undef PWCHANGE /**/
/*#undef PWCLASS /**/
/*#undef PWEXPIRE /**/
! #define PWCOMMENT /**/
/* I_SYS_FILE
* This manifest constant tells the C program to include <sys/file.h>.
--- 694,706 ----
* This symbol, if defined, indicates to the C program that struct passwd
* contains pw_comment.
*/
! /*#undef I_PWD /**/
/*#undef PWQUOTA /**/
! /*#undef PWAGE /**/
/*#undef PWCHANGE /**/
/*#undef PWCLASS /**/
/*#undef PWEXPIRE /**/
! /*#undef PWCOMMENT /**/
/* I_SYS_FILE
* This manifest constant tells the C program to include <sys/file.h>.
***************
*** 719,725 ****
* This symbol, if defined, indicates that sys/ioctl.h exists and should
* be included.
*/
! #define I_SYSIOCTL /**/
/* I_TIME
* This symbol is defined if the program should include <time.h>.
--- 711,717 ----
* This symbol, if defined, indicates that sys/ioctl.h exists and should
* be included.
*/
! /*#undef I_SYSIOCTL /**/
/* I_TIME
* This symbol is defined if the program should include <time.h>.
***************
*** 734,741 ****
/* I_SYS_SELECT
* This symbol is defined if the program should include <sys/select.h>.
*/
! /*#undef I_TIME /**/
! #define I_SYS_TIME /**/
/*#undef SYSTIMEKERNEL /**/
/*#undef I_SYS_SELECT /**/
--- 726,733 ----
/* I_SYS_SELECT
* This symbol is defined if the program should include <sys/select.h>.
*/
! #define I_TIME /**/
! /*#undef I_SYS_TIME /**/
/*#undef SYSTIMEKERNEL /**/
/*#undef I_SYS_SELECT /**/
***************
*** 749,755 ****
* This symbol, if defined, indicates to the C program that it should
* include varargs.h.
*/
! #define I_VARARGS /**/
/* I_VFORK
* This symbol, if defined, indicates to the C program that it should
--- 741,749 ----
* This symbol, if defined, indicates to the C program that it should
* include varargs.h.
*/
! /*#undef I_VARARGS /**/
!
! #define I_STDARG
/* I_VFORK
* This symbol, if defined, indicates to the C program that it should
***************
*** 788,799 ****
* of directory entry names is provided by a d_namlen field. Otherwise
* you need to do strlen() on the d_name field.
*/
! #define I_DIRENT /**/
/*#undef I_SYS_DIR /**/
/*#undef I_NDIR /**/
/*#undef I_SYS_NDIR /**/
/*#undef I_MY_DIR /**/
! /*#undef DIRNAMLEN /**/
/* MYMALLOC
* This symbol, if defined, indicates that we're using our own malloc.
--- 782,794 ----
* of directory entry names is provided by a d_namlen field. Otherwise
* you need to do strlen() on the d_name field.
*/
! /*#undef I_DIRENT /**/
/*#undef I_SYS_DIR /**/
/*#undef I_NDIR /**/
/*#undef I_SYS_NDIR /**/
/*#undef I_MY_DIR /**/
!
! #define DIRNAMLEN /**/
/* MYMALLOC
* This symbol, if defined, indicates that we're using our own malloc.
***************
*** 817,840 ****
* to keep publicly executable scripts for the package in question. It
* is often a directory that is mounted across diverse architectures.
*/
! #define SCRIPTDIR "/usr/local/bin" /**/
/* SIG_NAME
* This symbol contains an list of signal names in order.
*/
! #define SIG_NAME "ZERO","HUP","INT","QUIT","ILL","TRAP","ABRT","EMT","FPE","KILL","BUS","SEGV","SYS","PIPE","ALRM","TERM","USR1","USR2","CHLD","PWR","URG","IO","POLL","STOP","TSTP","TTIN","TTOU","CONT","VTALRM","PROF" /**/
/* STDCHAR
* This symbol is defined to be the type of char used in stdio.h.
* It has the values "unsigned char" or "char".
*/
! #define STDCHAR unsigned char /**/
/* UIDTYPE
* This symbol has a value like uid_t, int, ushort, or whatever type is
* used to declare user ids in the kernel.
*/
! #define UIDTYPE uid_t /**/
/* VOIDHAVE
* This symbol indicates how much support of the void type is given by this
--- 812,837 ----
* to keep publicly executable scripts for the package in question. It
* is often a directory that is mounted across diverse architectures.
*/
! #define SCRIPTDIR (char *)NtGetBin()
! #define DEFSCRIPT "C:\\win32app\\ingr\\perl\\bin" /**/
/* SIG_NAME
* This symbol contains an list of signal names in order.
*/
! #define SIG_NAME "0","1","INT","3","ILL","5","6","7","FPE","9","10","SEGV",\
! "12","13","14","TERM","16","17","18","19","20","BREAK","ABRT"
/* STDCHAR
* This symbol is defined to be the type of char used in stdio.h.
* It has the values "unsigned char" or "char".
*/
! #define STDCHAR char /**/
/* UIDTYPE
* This symbol has a value like uid_t, int, ushort, or whatever type is
* used to declare user ids in the kernel.
*/
! #define UIDTYPE unsigned short
/* VOIDHAVE
* This symbol indicates how much support of the void type is given by this
***************
*** 861,885 ****
* appropriately. Otherwise, its value is the empty string. The primary
* use of this symbol is in specifying void parameter lists for function
* prototypes.
*/
/* VOIDP
* This symbol is used for casting generic pointers. On implementations
* which support void appropriately, its value is "void *". Otherwise,
* its value is "char *".
*/
- #ifndef VOIDWANT
- #define VOIDWANT 7
- #endif
- #define VOIDHAVE 7
- #if (VOIDHAVE & VOIDWANT) != VOIDWANT
- #define void int /* is void to be avoided? */
- #define VOID
- #define VOIDP (char *)
- #define M_VOID /* Xenix strikes again */
- #else
- #define VOID void
#define VOIDP (void *)
- #endif
/* PRIVLIB
* This symbol contains the name of the private library for this package.
--- 858,872 ----
* appropriately. Otherwise, its value is the empty string. The primary
* use of this symbol is in specifying void parameter lists for function
* prototypes.
+ * N.B. Don't define this for NT, since they use VOID as a conditional
+ * to define other types.
*/
/* VOIDP
* This symbol is used for casting generic pointers. On implementations
* which support void appropriately, its value is "void *". Otherwise,
* its value is "char *".
*/
#define VOIDP (void *)
/* PRIVLIB
* This symbol contains the name of the private library for this package.
***************
*** 887,892 ****
* execution path, but it should be accessible by the world. The program
* should be prepared to do ~ expansion.
*/
! #define PRIVLIB "/usr/local/lib/perl" /**/
#endif
--- 874,885 ----
* execution path, but it should be accessible by the world. The program
* should be prepared to do ~ expansion.
*/
! #define DEFPRIVLIB "C:\\win32app\\ingr\\perl\\lib"
! #define PRIVLIB (char *) NtGetLib()
!
! #define HAS_GETLOGIN
+ #include "nt.h"
+
#endif
+
*** ../src-4.036/cons.c Tue Apr 6 15:42:06 1993
--- cons.c Fri May 21 09:17:57 1993
***************
*** 969,974 ****
--- 972,980 ----
if (++error_count >= 10)
fatal("%s has too many errors.\n",
stab_val(curcmd->c_filestab)->str_ptr);
+ #if defined(NT)
+ return 0;
+ #endif
}
void
*** ../src-4.036/doio.c Tue Apr 6 15:42:04 1993
--- doio.c Fri May 21 09:18:52 1993
***************
*** 52,62 ****
--- 55,69 ----
#include "perl.h"
#ifdef HAS_SOCKET
+ #if !defined(NT)
#include <sys/socket.h>
#include <netdb.h>
#ifndef ENOTSOCK
#include <net/errno.h>
#endif
+ #else
+ #define ENOTSOCK WSAENOTSOCK
+ #endif
#endif
#ifdef HAS_SELECT
***************
*** 68,75 ****
--- 75,84 ----
#endif
#ifdef HOST_NOT_FOUND
+ #if !defined(NT)
extern int h_errno;
#endif
+ #endif
#if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
#include <sys/ipc.h>
***************
*** 91,98 ****
--- 100,111 ----
#include <grp.h>
#endif
#ifdef I_UTIME
+ #if defined(NT)
+ #include <sys/utime.h>
+ #else
#include <utime.h>
#endif
+ #endif
#ifdef I_FCNTL
#include <fcntl.h>
#endif
***************
*** 584,589 ****
--- 597,610 ----
retval = (status == 0);
statusvalue = (unsigned short)status & 0xffff;
}
+ #if defined(NT)
+ else if (stio->type == 's') {
+ SOCKET s = fileno(stio->ifp);
+ Safefree(stio->ifp);
+ Safefree(stio->ofp);
+ retval = closesocket(s) == SOCKET_ERROR ? FALSE : TRUE;
+ }
+ #endif
else if (stio->type == '-')
retval = TRUE;
else {
***************
*** 733,739 ****
#else
retval = 256; /* otherwise guess at what's safe */
#endif
! if (argstr->str_cur < retval) {
Str_Grow(argstr,retval+1);
argstr->str_cur = retval;
}
--- 754,760 ----
#else
retval = 256; /* otherwise guess at what's safe */
#endif
! if (argstr->str_cur < (unsigned long) retval) {
Str_Grow(argstr,retval+1);
argstr->str_cur = retval;
}
***************
*** 955,962 ****
--- 976,988 ----
else {
int tmpfd;
+ #if defined(NT)
+ if ((tmpfd = open(str_get(ary->ary_array[sp]), O_RDWR)) < 0)
+ result = 0;
+ #else
if ((tmpfd = open(str_get(ary->ary_array[sp]), 0)) < 0)
result = 0;
+ #endif
else {
if (chsize(tmpfd, len) < 0)
result = 0;
***************
*** 1412,1419 ****
--- 1438,1452 ----
taintproper("Insecure dependency in socket");
#endif
fd = socket(domain,type,protocol);
+ #if defined(NT)
+ if (fd == SOCKET_ERROR) {
+ errno = WSAGetLastError();
+ return FALSE;
+ }
+ #else
if (fd < 0)
return FALSE;
+ #endif
stio->ifp = fdopen(fd, "r"); /* stdio gets confused about sockets */
stio->ofp = fdopen(fd, "w");
stio->type = 's';
***************
*** 1435,1441 ****
--- 1468,1478 ----
register STR **st = stack->ary_array;
register int sp = arglast[1];
register STIO *stio;
+ #if defined(NT)
+ struct sockaddr_in *addr;
+ #else
char *addr;
+ #endif
if (!stab)
goto nuts;
***************
*** 1444,1454 ****
--- 1481,1505 ----
if (!stio || !stio->ifp)
goto nuts;
+ #if defined(NT)
+ addr = (struct sockaddr_in *) str_get(st[++sp]);
+ #else
addr = str_get(st[++sp]);
+ #endif
#ifdef TAINT
taintproper("Insecure dependency in bind");
#endif
+ #if defined(NT)
+ if (bind(fileno(stio->ifp), addr, st[sp]->str_cur) == SOCKET_ERROR) {
+ errno = WSAGetLastError();
+ return FALSE;
+ }
+ else {
+ return TRUE;
+ }
+ #else
return bind(fileno(stio->ifp), addr, st[sp]->str_cur) >= 0;
+ #endif
nuts:
if (dowarn)
***************
*** 1466,1472 ****
--- 1517,1528 ----
register STR **st = stack->ary_array;
register int sp = arglast[1];
register STIO *stio;
+ #if defined(NT)
+ struct sockaddr_in *addr;
+ #else
char *addr;
+ #endif
+ int retval;
if (!stab)
goto nuts;
***************
*** 1475,1485 ****
--- 1531,1555 ----
if (!stio || !stio->ifp)
goto nuts;
+ #if defined(NT)
+ addr = (struct sockaddr_in *) str_get(st[++sp]);
+ #else
addr = str_get(st[++sp]);
+ #endif
#ifdef TAINT
taintproper("Insecure dependency in connect");
#endif
+ #if defined(NT)
+ if (connect(fileno(stio->ifp), addr, st[sp]->str_cur) == SOCKET_ERROR) {
+ errno = WSAGetLastError();
+ return FALSE;
+ }
+ else {
+ return TRUE;
+ }
+ #else
return connect(fileno(stio->ifp), addr, st[sp]->str_cur) >= 0;
+ #endif
nuts:
if (dowarn)
***************
*** 1507,1513 ****
--- 1577,1593 ----
goto nuts;
backlog = (int)str_gnum(st[++sp]);
+ #if defined(NT)
+ if ((listen(fileno(stio->ifp), backlog)) == SOCKET_ERROR) {
+ errno = WSAGetLastError();
+ return FALSE;
+ }
+ else {
+ return TRUE;
+ }
+ #else
return listen(fileno(stio->ifp), backlog) >= 0;
+ #endif
nuts:
if (dowarn)
***************
*** 1543,1550 ****
--- 1623,1637 ----
do_close(nstab,FALSE);
fd = accept(fileno(gstio->ifp),(struct sockaddr *)buf,&len);
+ #if defined(NT)
+ if (fd == SOCKET_ERROR) {
+ errno = WSAGetLastError();
+ goto badexit;
+ }
+ #else
if (fd < 0)
goto badexit;
+ #endif
nstio->ifp = fdopen(fd, "r");
nstio->ofp = fdopen(fd, "w");
nstio->type = 's';
***************
*** 1585,1591 ****
--- 1672,1688 ----
goto nuts;
how = (int)str_gnum(st[++sp]);
+ #if defined(NT)
+ if (shutdown(fileno(stio->ifp), how) == SOCKET_ERROR) {
+ errno = WSAGetLastError();
+ return FALSE;
+ }
+ else {
+ return TRUE;
+ }
+ #else
return shutdown(fileno(stio->ifp), how) >= 0;
+ #endif
nuts:
if (dowarn)
***************
*** 1623,1636 ****
--- 1720,1749 ----
st[sp] = str_2mortal(Str_new(22,257));
st[sp]->str_cur = 256;
st[sp]->str_pok = 1;
+ #if defined(NT)
+ if (getsockopt(fd, lvl, optname, st[sp]->str_ptr,
+ (int*)&st[sp]->str_cur) == SOCKET_ERROR) {
+ errno = WSAGetLastError();
+ goto nuts;
+ }
+ #else
if (getsockopt(fd, lvl, optname, st[sp]->str_ptr,
(int*)&st[sp]->str_cur) < 0)
goto nuts;
+ #endif
break;
case O_SSOCKOPT:
st[sp] = st[sp+3];
+ #if defined(NT)
+ if (setsockopt(fd, lvl, optname, st[sp]->str_ptr, st[sp]->str_cur) ==
+ SOCKET_ERROR) {
+ errno = WSAGetLastError();
+ goto nuts;
+ }
+ #else
if (setsockopt(fd, lvl, optname, st[sp]->str_ptr, st[sp]->str_cur) < 0)
goto nuts;
+ #endif
st[sp] = &str_yes;
break;
}
***************
*** 1670,1681 ****
--- 1783,1810 ----
fd = fileno(stio->ifp);
switch (optype) {
case O_GETSOCKNAME:
+ #if defined(NT)
+ if (getsockname(fd, st[sp]->str_ptr, (int*)&st[sp]->str_cur) ==
+ SOCKET_ERROR) {
+ errno = WSAGetLastError();
+ goto nuts2;
+ }
+ #else
if (getsockname(fd, st[sp]->str_ptr, (int*)&st[sp]->str_cur) < 0)
goto nuts2;
+ #endif
break;
case O_GETPEERNAME:
+ #if defined(NT)
+ if (getpeername(fd, st[sp]->str_ptr, (int*)&st[sp]->str_cur) ==
+ SOCKET_ERROR) {
+ errno = WSAGetLastError();
+ goto nuts2;
+ }
+ #else
if (getpeername(fd, st[sp]->str_ptr, (int*)&st[sp]->str_cur) < 0)
goto nuts2;
+ #endif
break;
}
***************
*** 1701,1708 ****
--- 1830,1839 ----
register int sp = arglast[0];
register char **elem;
register STR *str;
+ #if !defined(NT)
struct hostent *gethostbyname();
struct hostent *gethostbyaddr();
+ #endif
#ifdef HAS_GETHOSTENT
struct hostent *gethostent();
#endif
***************
*** 1754,1760 ****
--- 1885,1895 ----
(void)astore(ary, ++sp, str = str_mortal(&str_no));
str_set(str, hent->h_name);
(void)astore(ary, ++sp, str = str_mortal(&str_no));
+ #if defined(NT)
+ for (elem = hent->h_aliases; elem && *elem; elem++) {
+ #else
for (elem = hent->h_aliases; *elem; elem++) {
+ #endif
str_cat(str, *elem);
if (elem[1])
str_ncat(str," ",1);
***************
*** 1857,1864 ****
--- 1992,2001 ----
register int sp = arglast[0];
register char **elem;
register STR *str;
+ #if !defined(NT)
struct protoent *getprotobyname();
struct protoent *getprotobynumber();
+ #endif
struct protoent *getprotoent();
struct protoent *pent;
***************
*** 1918,1924 ****
--- 2055,2063 ----
register int sp = arglast[0];
register char **elem;
register STR *str;
+ #if !defined(NT)
struct servent *getservbyname();
+ #endif
struct servent *getservbynumber();
struct servent *getservent();
struct servent *sent;
*** ../src-4.036/dolist.c Tue Apr 6 15:42:24 1993
--- dolist.c Fri May 21 09:18:54 1993
***************
***************
*** 1814,1820 ****
int gimme;
int *arglast;
{
! #ifdef MSDOS
return -1;
#else
STR **st = stack->ary_array;
--- 1817,1823 ----
int gimme;
int *arglast;
{
! #if defined(MSDOS) || defined(NT)
return -1;
#else
STR **st = stack->ary_array;
*** ../src-4.036/eval.c Tue Apr 6 15:42:17 1993
--- eval.c Fri May 21 09:18:59 1993
***************
*** 117,123 ****
double exp(), log(), sqrt(), modf();
char *crypt(), *getenv();
extern void grow_dlevel();
!
if (!arg)
goto say_undef;
optype = arg->arg_type;
--- 120,128 ----
double exp(), log(), sqrt(), modf();
char *crypt(), *getenv();
extern void grow_dlevel();
! #if defined(NT)
! extern bool NtSyncProcess;
! #endif
if (!arg)
goto say_undef;
optype = arg->arg_type;
***************
*** 521,530 ****
str->str_cur++;
for (tmps = str->str_ptr; *tmps; tmps++)
if (!isALPHA(*tmps) && !isDIGIT(*tmps) &&
! index("$&*(){}[]'\";\\|?<>~`",*tmps))
break;
! if (*tmps && stat(str->str_ptr,&statbuf) < 0)
goto keepgoing; /* unmatched wildcard? */
}
if (gimme == G_ARRAY) {
if (str->str_len - str->str_cur > 20) {
--- 526,537 ----
str->str_cur++;
for (tmps = str->str_ptr; *tmps; tmps++)
if (!isALPHA(*tmps) && !isDIGIT(*tmps) &&
! index("$&*(){}[]'\";\\|?<>~`",*tmps))
break;
!
! if (*tmps && stat(str->str_ptr,&statbuf) < 0) {
goto keepgoing; /* unmatched wildcard? */
+ }
}
if (gimme == G_ARRAY) {
if (str->str_len - str->str_cur > 20) {
***************
*** 1239,1246 ****
lstr = (struct lstring*)str;
str->str_magic = st[1];
st[1]->str_rare = 's';
! lstr->lstr_offset = tmps - str_get(st[1]);
! lstr->lstr_len = anum;
}
}
break;
--- 1246,1253 ----
lstr = (struct lstring*)str;
str->str_magic = st[1];
st[1]->str_rare = 's';
! lstr->lstr_offset = tmps - str_get(st[1]);
! lstr->lstr_len = anum;
}
}
break;
***************
*** 1481,1486 ****
--- 1488,1496 ----
str_nset(str,buf,argtype);
}
else
+ #if defined(NT)
+ errno = WSAGetLastError();
+ #endif
str_sset(str,&str_undef);
break;
}
***************
*** 1490,1495 ****
--- 1500,1512 ----
#endif
STR_GROW(st[2], anum+maxarg+1), (tmps = str_get(st[2])); /* sneaky */
if (optype == O_SYSREAD) {
+ #if defined(NT)
+ if (stab_io(stab)->type == 's') {
+ warn ("NT does not support read on sockets");
+ str_sset(str, &str_undef);
+ break;
+ }
+ #endif
anum = read(fileno(stab_io(stab)->ifp), tmps+maxarg, anum);
}
else
***************
*** 1498,1503 ****
--- 1515,1526 ----
argtype = sizeof buf;
anum = recvfrom(fileno(stab_io(stab)->ifp), tmps+maxarg, anum, 0,
buf, &argtype);
+ #if defined(NT)
+ if (anum == SOCKET_ERROR) {
+ errno = WSAGetLastError();
+ goto say_undef;
+ }
+ #endif
}
else
#endif
***************
*** 1529,1534 ****
--- 1552,1563 ----
}
}
else if (optype == O_SYSWRITE) {
+ #if defined(NT)
+ if (stab_io(stab)->type == 's') {
+ warn("NT does not support writes to sockets");
+ break;
+ }
+ #endif
if (maxarg > 4)
warn("Too many args on syswrite");
if (maxarg == 4)
***************
*** 1551,1558 ****
--- 1580,1594 ----
else
goto badsock;
#endif
+ #if defined(NT)
+ if (anum == SOCKET_ERROR) {
+ errno = WSAGetLastError();
+ goto say_undef;
+ }
+ #else
if (anum < 0)
goto say_undef;
+ #endif
value = (double)anum;
goto donumset;
case O_SEEK:
***************
*** 2015,2020 ****
--- 2051,2059 ----
}
_exit(-1);
#else /* ! FORK */
+ #if defined(NT)
+ NtSyncProcess = TRUE;
+ #endif
if ((arg[1].arg_type & A_MASK) == A_STAB)
value = (double)do_aspawn(st[1],arglast);
else if (arglast[2] - arglast[1] != 1)
***************
*** 2022,2027 ****
--- 2061,2069 ----
else {
value = (double)do_spawn(str_get(str_mortal(st[2])));
}
+ #if defined(NT)
+ NtSyncProcess = FALSE;
+ #endif
goto donumset;
#endif /* FORK */
case O_EXEC_OP:
***************
*** 2247,2253 ****
--- 2289,2299 ----
taintproper("Insecure dependency in mkdir");
#endif
#ifdef HAS_MKDIR
+ #if defined(NT)
+ value = (double)(mkdir(tmps) >= 0);
+ #else
value = (double)(mkdir(tmps,anum) >= 0);
+ #endif
goto donumset;
#else
(void)strcpy(buf,"mkdir ");
*** ../src-4.036/perl.c Tue Apr 6 15:42:24 1993
--- perl.c Mon May 24 12:19:12 1993
***************
*** 59,65 ****
--- 62,72 ----
#include "EXTERN.h"
#include "perl.h"
#include "perly.h"
+ #if defined(NT)
+ #include "patchlvl.h"
+ #else
#include "patchlevel.h"
+ #endif
char *getenv();
***************
*** 84,93 ****
--- 91,104 ----
static int nrschar = '\n'; /* final char of rs, or 0777 if none */
static int nrslen = 1;
+ #if defined(NT)
+ main(int fooargc, char **fooargv, char **env)
+ #else
main(argc,argv,env)
register int argc;
register char **argv;
register char **env;
+ #endif
{
register STR *str;
register char *s;
***************
*** 97,103 ****
#ifdef DOSUID
char *validarg = "";
#endif
!
#ifdef SETUID_SCRIPTS_ARE_SECURE_NOW
#ifdef IAMSUID
#undef IAMSUID
--- 108,117 ----
#ifdef DOSUID
char *validarg = "";
#endif
! #if defined(NT)
! int argc;
! char **argv;
! #endif
#ifdef SETUID_SCRIPTS_ARE_SECURE_NOW
#ifdef IAMSUID
#undef IAMSUID
***************
*** 106,111 ****
--- 120,129 ----
#endif
#endif
+ #if defined(NT)
+ (void) NtInitialize(&argc, &argv);
+ #endif /* NT */
+
origargv = argv;
origargc = argc;
origenviron = environ;
***************
*** 114,119 ****
--- 132,138 ----
gid = (int)getgid();
egid = (int)getegid();
sprintf(patchlevel,"%3.3s%2.2d", index(rcsid,'4'), PATCHLEVEL);
+
#ifdef MSDOS
/*
* There is no way we can refer to them from Perl so close them to save
***************
*** 180,186 ****
fatal("No -e allowed in setuid scripts");
#endif
if (!e_fp) {
! e_tmpname = savestr(TMPPATH);
(void)mktemp(e_tmpname);
if (!*e_tmpname)
fatal("Can't mktemp()");
--- 199,223 ----
fatal("No -e allowed in setuid scripts");
#endif
if (!e_fp) {
! #if defined(NT)
! do {
! char tbuffer[_MAX_PATH+10];
! int len = GetTempPath(_MAX_PATH+1, tbuffer);
!
! if (len) {
! if (tbuffer[len-1] == '\\')
! strcat (tbuffer, "plXXXXXX");
! else
! strcat(tbuffer, "\\plXXXXXX");
! e_tmpname = savestr(tbuffer);
! }
! else {
! e_tmpname = savestr(TMPPATH);
! }
! } while (0);
! #else
! e_tmpname = savestr(TMPPATH);
! #endif
(void)mktemp(e_tmpname);
if (!*e_tmpname)
fatal("Can't mktemp()");
***************
*** 1388,1393 ****
--- 1425,1433 ----
#ifdef atarist
fputs("atariST series port, ++jrb bammi@cadence.com\n", stdout);
#endif
+ #if defined(NT)
+ fputs("NT Copyright (c) 1993, Intergraph Corporation\n", stdout);
+ #endif
fputs("\n\
Perl may be copied only under the terms of either the Artistic License or the\n\
GNU General Public License, which may be found in the Perl 4.0 source kit.\n",stdout);
*** ../src-4.036/perl.h Tue Apr 6 15:42:05 1993
--- perl.h Fri May 21 09:21:02 1993
***************
*** 63,69 ****
#endif
/* define this once if either system, instead of cluttering up the src */
! #if defined(MSDOS) || defined(atarist)
#define DOSISH 1
#endif
--- 63,69 ----
#endif
/* define this once if either system, instead of cluttering up the src */
! #if defined(MSDOS) || defined(atarist) || defined(NT)
#define DOSISH 1
#endif
***************
*** 101,106 ****
--- 101,110 ----
# define STANDARD_C 1
#endif
+ #if defined(NT) && !defined(STANDARD_C)
+ #define STANDARD_C
+ #endif
+
#if defined(HASVOLATILE) || defined(STANDARD_C)
#define VOLATILE volatile
#else
***************
*** 132,140 ****
#endif
#include <stdio.h>
#include <ctype.h>
#include <setjmp.h>
! #ifndef MSDOS
#ifdef PARAM_NEEDS_TYPES
#include <sys/types.h>
#endif
--- 136,150 ----
#endif
#include <stdio.h>
+
+ #if defined(NT)
+ #undef fdopen
+ #define fdopen myfdopen
+ #endif /* NT */
+
#include <ctype.h>
#include <setjmp.h>
! #if !defined(MSDOS) && !defined(NT)
#ifdef PARAM_NEEDS_TYPES
#include <sys/types.h>
#endif
***************
*** 259,265 ****
# endif
#endif
! #ifndef MSDOS
#include <sys/times.h>
#endif
--- 269,275 ----
# endif
#endif
! #if !defined(MSDOS) && !defined(NT)
#include <sys/times.h>
#endif
***************
*** 533,538 ****
--- 543,561 ----
typedef struct stab STAB;
typedef struct callsave CSV;
+ #if defined(NT)
+ /* had to wait til here to declare these guys, since STR and FILE aren\'t
+ declared until now */
+ extern int looks_like_number (STR *);
+ extern FILE *mypopen (char *, char *);
+ extern FILE *myfdopen(int, char *);
+ extern int mypclose (FILE *);
+ extern int do_aspawn (STR *, int *);
+ extern int do_spawn (char *);
+ extern void add_suffix (STR *, char *);
+ extern int yyparse(void);
+ #endif
+
#include "handy.h"
#include "regexp.h"
#include "str.h"
***************
*** 801,808 ****
--- 824,836 ----
void dehoist();
void format();
void my_unexec();
+ #if defined(NT)
+ void fatal(char *, ...);
+ void warn(char *, ...);
+ #else
void fatal();
void warn();
+ #endif
#ifdef DEBUGGING
void dump_all();
void dump_cmd();
***************
*** 956,962 ****
EXT struct stat statcache;
EXT STAB *statstab INIT(Nullstab);
EXT STR *statname INIT(Nullstr);
! #ifndef MSDOS
EXT struct tms timesbuf;
#endif
EXT int uid;
--- 984,990 ----
EXT struct stat statcache;
EXT STAB *statstab INIT(Nullstab);
EXT STR *statname INIT(Nullstr);
! #if !defined(MSDOS) && !defined(NT)
EXT struct tms timesbuf;
#endif
EXT int uid;
*** ../src-4.036/perly.h Thu Apr 15 12:13:54 1993
--- perly.h Fri May 21 09:21:14 1993
***************
*** 41,46 ****
--- 41,47 ----
#define SUB 297
#define FILETEST 298
#define LOCAL 299
+ #undef DELETE
#define DELETE 300
#define RELOP 301
#define EQOP 302
*** ../src-4.036/util.c Tue Apr 6 15:42:20 1993
--- util.c Fri May 21 09:23:47 1993
***************
*** 57,62 ****
--- 57,66 ----
# include <varargs.h>
#endif
+ #ifdef I_STDARG
+ # include <stdarg.h>
+ #endif
+
#ifdef I_FCNTL
# include <fcntl.h>
#endif
***************
*** 857,881 ****
}
}
! #ifndef I_VARARGS
! /*VARARGS1*/
char *
! mess(pat,a1,a2,a3,a4)
! char *pat;
! long a1, a2, a3, a4;
{
char *s;
- int usermess = strEQ(pat,"%s");
STR *tmpstr;
s = buf;
if (usermess) {
tmpstr = str_mortal(&str_undef);
! str_set(tmpstr, (char*)a1);
*s++ = tmpstr->str_ptr[tmpstr->str_cur-1];
}
else {
! (void)sprintf(s,pat,a1,a2,a3,a4);
s += strlen(s);
}
--- 861,898 ----
}
}
! #if defined(I_VARARGS)
! /*VARARGS0*/
char *
! mess(args)
! va_list args;
{
+ char *pat;
char *s;
STR *tmpstr;
+ int usermess;
+ #ifndef HAS_VPRINTF
+ #ifdef CHARVSPRINTF
+ char *vsprintf();
+ #else
+ int vsprintf();
+ #endif
+ #endif
+ #ifdef lint
+ pat = Nullch;
+ #else
+ pat = va_arg(args, char *);
+ #endif
s = buf;
+ usermess = strEQ(pat, "%s");
if (usermess) {
tmpstr = str_mortal(&str_undef);
! str_set(tmpstr, va_arg(args, char *));
*s++ = tmpstr->str_ptr[tmpstr->str_cur-1];
}
else {
! (void) vsprintf(s,pat,args);
s += strlen(s);
}
***************
*** 889,895 ****
stab_io(last_in_stab) &&
stab_io(last_in_stab)->lines ) {
(void)sprintf(s,", <%s> line %ld",
! last_in_stab == argvstab ? "" : stab_ename(last_in_stab),
(long)stab_io(last_in_stab)->lines);
s += strlen(s);
}
--- 906,912 ----
stab_io(last_in_stab) &&
stab_io(last_in_stab)->lines ) {
(void)sprintf(s,", <%s> line %ld",
! last_in_stab == argvstab ? "" : last_in_stab->str_magic->str_ptr,
(long)stab_io(last_in_stab)->lines);
s += strlen(s);
}
***************
*** 897,919 ****
if (usermess)
str_cat(tmpstr,buf+1);
}
if (usermess)
return tmpstr->str_ptr;
else
return buf;
}
! /*VARARGS1*/
! void fatal(pat,a1,a2,a3,a4)
! char *pat;
! long a1, a2, a3, a4;
{
extern FILE *e_fp;
extern char *e_tmpname;
char *tmps;
char *message;
! message = mess(pat,a1,a2,a3,a4);
if (in_eval) {
str_set(stab_val(stabent("@",TRUE)),message);
tmps = "_EVAL_";
--- 914,943 ----
if (usermess)
str_cat(tmpstr,buf+1);
}
+
if (usermess)
return tmpstr->str_ptr;
else
return buf;
}
! /*VARARGS0*/
! void fatal(va_alist)
! va_dcl
{
+ va_list args;
extern FILE *e_fp;
extern char *e_tmpname;
char *tmps;
char *message;
! #ifndef lint
! va_start(args);
! #else
! args = 0;
! #endif
! message = mess(args);
! va_end(args);
if (in_eval) {
str_set(stab_val(stabent("@",TRUE)),message);
tmps = "_EVAL_";
***************
*** 947,960 ****
exit((int)((errno&255)?errno:((statusvalue&255)?statusvalue:255)));
}
! /*VARARGS1*/
! void warn(pat,a1,a2,a3,a4)
! char *pat;
! long a1, a2, a3, a4;
{
char *message;
! message = mess(pat,a1,a2,a3,a4);
fputs(message,stderr);
#ifdef LEAKTEST
#ifdef DEBUGGING
--- 971,991 ----
exit((int)((errno&255)?errno:((statusvalue&255)?statusvalue:255)));
}
! /*VARARGS0*/
! void warn(va_alist)
! va_dcl
{
+ va_list args;
char *message;
! #ifndef lint
! va_start(args);
! #else
! args = 0;
! #endif
! message = mess(args);
! va_end(args);
!
fputs(message,stderr);
#ifdef LEAKTEST
#ifdef DEBUGGING
***************
*** 964,976 ****
#endif
(void)fflush(stderr);
}
! #else
! /*VARARGS0*/
char *
! mess(args)
! va_list args;
{
- char *pat;
char *s;
STR *tmpstr;
int usermess;
--- 995,1008 ----
#endif
(void)fflush(stderr);
}
!
! #elif defined(I_STDARG)
!
! /* Use this for NT */
!
char *
! mess(char *pat, va_list args)
{
char *s;
STR *tmpstr;
int usermess;
***************
*** 981,992 ****
int vsprintf();
#endif
#endif
-
- #ifdef lint
- pat = Nullch;
- #else
- pat = va_arg(args, char *);
- #endif
s = buf;
usermess = strEQ(pat, "%s");
if (usermess) {
--- 1013,1018 ----
***************
*** 1025,1032 ****
}
/*VARARGS0*/
! void fatal(va_alist)
! va_dcl
{
va_list args;
extern FILE *e_fp;
--- 1051,1057 ----
}
/*VARARGS0*/
! void fatal(char *pat, ...)
{
va_list args;
extern FILE *e_fp;
***************
*** 1035,1045 ****
char *message;
#ifndef lint
! va_start(args);
#else
args = 0;
#endif
! message = mess(args);
va_end(args);
if (in_eval) {
str_set(stab_val(stabent("@",TRUE)),message);
--- 1060,1070 ----
char *message;
#ifndef lint
! va_start(args, pat);
#else
args = 0;
#endif
! message = mess(pat, args);
va_end(args);
if (in_eval) {
str_set(stab_val(stabent("@",TRUE)),message);
***************
*** 1075,1092 ****
}
/*VARARGS0*/
! void warn(va_alist)
! va_dcl
{
va_list args;
char *message;
#ifndef lint
! va_start(args);
#else
args = 0;
#endif
! message = mess(args);
va_end(args);
fputs(message,stderr);
--- 1100,1116 ----
}
/*VARARGS0*/
! void warn(char *pat, ...)
{
va_list args;
char *message;
#ifndef lint
! va_start(args, pat);
#else
args = 0;
#endif
! message = mess(pat, args);
va_end(args);
fputs(message,stderr);
***************
*** 1098,1104 ****
--- 1122,1236 ----
#endif
(void)fflush(stderr);
}
+
+ #else
+ /*VARARGS1*/
+ char *
+ mess(pat,a1,a2,a3,a4)
+ char *pat;
+ long a1, a2, a3, a4;
+ {
+ char *s;
+ int usermess = strEQ(pat,"%s");
+ STR *tmpstr;
+
+ s = buf;
+ if (usermess) {
+ tmpstr = str_mortal(&str_undef);
+ str_set(tmpstr, (char*)a1);
+ *s++ = tmpstr->str_ptr[tmpstr->str_cur-1];
+ }
+ else {
+ (void)sprintf(s,pat,a1,a2,a3,a4);
+ s += strlen(s);
+ }
+
+ if (s[-1] != '\n') {
+ if (curcmd->c_line) {
+ (void)sprintf(s," at %s line %ld",
+ stab_val(curcmd->c_filestab)->str_ptr, (long)curcmd->c_line);
+ s += strlen(s);
+ }
+ if (last_in_stab &&
+ stab_io(last_in_stab) &&
+ stab_io(last_in_stab)->lines ) {
+ (void)sprintf(s,", <%s> line %ld",
+ last_in_stab == argvstab ? "" : stab_ename(last_in_stab),
+ (long)stab_io(last_in_stab)->lines);
+ s += strlen(s);
+ }
+ (void)strcpy(s,".\n");
+ if (usermess)
+ str_cat(tmpstr,buf+1);
+ }
+ if (usermess)
+ return tmpstr->str_ptr;
+ else
+ return buf;
+ }
+
+ /*VARARGS1*/
+ void fatal(pat,a1,a2,a3,a4)
+ char *pat;
+ long a1, a2, a3, a4;
+ {
+ extern FILE *e_fp;
+ extern char *e_tmpname;
+ char *tmps;
+ char *message;
+
+ message = mess(pat,a1,a2,a3,a4);
+ if (in_eval) {
+ str_set(stab_val(stabent("@",TRUE)),message);
+ tmps = "_EVAL_";
+ while (loop_ptr >= 0 && (!loop_stack[loop_ptr].loop_label ||
+ strNE(tmps,loop_stack[loop_ptr].loop_label) )) {
+ #ifdef DEBUGGING
+ if (debug & 4) {
+ deb("(Skipping label #%d %s)\n",loop_ptr,
+ loop_stack[loop_ptr].loop_label);
+ }
+ #endif
+ loop_ptr--;
+ }
+ #ifdef DEBUGGING
+ if (debug & 4) {
+ deb("(Found label #%d %s)\n",loop_ptr,
+ loop_stack[loop_ptr].loop_label);
+ }
+ #endif
+ if (loop_ptr < 0) {
+ in_eval = 0;
+ fatal("Bad label: %s", tmps);
+ }
+ longjmp(loop_stack[loop_ptr].loop_env, 1);
+ }
+ fputs(message,stderr);
+ (void)fflush(stderr);
+ if (e_fp)
+ (void)UNLINK(e_tmpname);
+ statusvalue >>= 8;
+ exit((int)((errno&255)?errno:((statusvalue&255)?statusvalue:255)));
+ }
+
+ /*VARARGS1*/
+ void warn(pat,a1,a2,a3,a4)
+ char *pat;
+ long a1, a2, a3, a4;
+ {
+ char *message;
+
+ message = mess(pat,a1,a2,a3,a4);
+ fputs(message,stderr);
+ #ifdef LEAKTEST
+ #ifdef DEBUGGING
+ if (debug & 4096)
+ xstat();
#endif
+ #endif
+ (void)fflush(stderr);
+ }
+ #endif /* Not I_VARARGS or I_STDARG */
void
my_setenv(nam,val)